﻿#ifndef ROBOTCMDNODE_SERIAL_H_H_
#define ROBOTCMDNODE_SERIAL_H_H_

/*****************************************************************************
** Includes
*****************************************************************************/
//ROS2
#include "rclcpp/rclcpp.hpp"
#include "pccmd_msg/msg/pc_cmd.hpp"
//CPP
#include <chrono>
#include <memory>
#include <functional>
#include <string>

class SerialPinch;

class RobotCmdNode : public rclcpp::Node
{
public:
	RobotCmdNode(SerialPinch* sp);
	virtual ~RobotCmdNode();

private:

	void topic_callback(const pccmd_msg::msg::PcCmd::SharedPtr msg) const;

	void getParameters();

private:
	rclcpp::Subscription<pccmd_msg::msg::PcCmd>::SharedPtr subscription_;

	SerialPinch* m_sp;
	std::string m_strComName;
	int m_nMaxI;
	int m_nCmderType;  // 1: old,  2: new
};

#endif /* ROBOTCMDNODE_SERIAL_H_H_ */
